# Sustainable Office Designer
# by Fabian Ritter <Fabian.Ritter@live.de>, 2012

require("SOD/tools/AddFaceTool")

module SOD
  
  class AddFootprintTool < AddFaceTool
    
    def initialize
      @cursor = UI.create_cursor(Plugin.dir + "/icons/FootprintCursor.tif", 3, 3)
    end
    
    def createFace
      if(@pts[0] != @pts[3])
        if self.planar?
          puts @pts if $debug
          Plugin.model.addBar(@pts)
        end
      end
      self.reset
    end
    
  end
  
  class AddCoreTool < AddRelatedFaceTool
    
    def initialize
      @cursor = UI.create_cursor(Plugin.dir + "/icons/FootprintCursor.tif", 3, 3)
    end
    
    def createFace
      if(@pts[0] != @pts[3])
        if self.planar?
          puts @pts if $debug
          Plugin.model.addCore(@activeBar, @pts)
        end
      end
      self.reset
    end
    
  end
  
end